<template>
  <div>
    <MyTable :arr="list">
      <template #header>
        <th>#</th>
        <th>商品名称</th>
        <th>价格</th>
        <th>标签</th>
        <th>操作</th>
      </template>
      <template v-slot:footer="scope">
         <td>{{scope.id}}</td>
        <td>{{scope.goods_name}}</td>
        <td>{{scope.goods_price}}</td>
        <td>{{scope.tags[0]}} {{scope.tags[1]}}</td>
        <td>
            <button class="btn btn-danger btn-sm">删除</button>
        </td>
      </template>
    </MyTable>
  </div>
</template>

<script>
import MyTable from "../components/MyTable.vue"
import axios from 'axios'
axios.defaults.baseURL="https://www.escook.cn"
export default {
  components:{
    MyTable
  },
  created(){
    axios({
      url:'/api/goods'
    })
    .then(res=>{
      console.log(res)
      this.list=res.data.data
    })
  },
  data(){
    return{
      list:[]
    }
  }
}
</script>

<style>

</style>